<%@page import="java.security.interfaces.RSAKey"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ISMall-欢迎登录</title>
<link rel="icon" href="${pageContext.request.contextPath}/image/logoBigBl.ico" >
<script src="${pageContext.request.contextPath}/js/jquery.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/login.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap/css/bootstrap.min.css">
<script src="${pageContext.request.contextPath}/css/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/sort.js"></script>
<script src="${pageContext.request.contextPath}/js/holder.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.validate.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/login.js"></script>
</head>
<script type="text/javascript">
	function reloadcode() {
		var verify = document.getElementById('code');
		verify.setAttribute("src", "${pageContext.request.contextPath}/verificationcodeimg?it=" + Math.random());
	}
</script>


<body onload="input_value()">
	<div class="row">
		<div class="col-md-4" role="navigation">
			<!-- <h1 style="font-size: 20px;margin-top: 9px">东大咸鱼</h1> -->

			<ul class="nav nav-pills">
				<c:if test="${empty sessionScope.user}">
					<li><a href="${pageContext.request.contextPath}/login" style="color: #F22E00">请登录</a></li>
				</c:if>
				<c:if test="${!empty sessionScope.user}">
					<li class="info-a">
						<a href="${pageContext.request.contextPath}/information" style="color: #F22E00">
								${sessionScope.user.username}
							<span class="glyphicon glyphicon-triangle-bottom" style="font-size: 5px;margin-left: 7px;" aria-hidden="true">
						</span>
						</a>
						<ul class="dropdown-menu">
							<li><a href="${pageContext.request.contextPath}/information">账户管理</a></li>
							<li role="separator" class="divider"></li>
							<li><a href="${pageContext.request.contextPath}/logout" class="login-out">退出登录</a></li>
						</ul>
					</li>
				</c:if>

				<li><a href="${pageContext.request.contextPath}/register">注册</a></li>
			</ul>
		</div>
		<div class="col-md-8">
			<ul class="nav nav-pills pull-right">
				<li><a href="${pageContext.request.contextPath}/chat"> <i
						class="fa fa-comment"></i> 消息
				</a></li>
				<li><a href="${pageContext.request.contextPath}/showcart"> <i
						class="fa fa-shopping-cart" style="color: #F22E00"></i>
					购物车
				</a></li>
				<li><a href="${pageContext.request.contextPath}/info/favorite"> <i
						class="fa fa-star"></i> 收藏夹
				</a></li>
			</ul>
		</div>
	</div>
	<div id="header-nav" class="box box-active">
		<nav class="navbar navbar-default" id="header-nav-middle" style="margin: 0px; border: 0px;padding: 0px;">
			<div class="container-fluid">
				<!-- Brand and toggle get grouped for better mobile display -->
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed"
							data-toggle="collapse"
							data-target="#bs-example-navbar-collapse-1"
							aria-expanded="false">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="${pageContext.request.contextPath}/main"><!-- <img alt="Brand" style="display: inline-block;" src="./image/tao.jpg" width="20" height="20"> --><span class="logo-word">IS-Shopping</span></a>
				</div>

				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse"
					 id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li><a class="a-color" href="${pageContext.request.contextPath}/main">首页</a></li>
						<li><a class="a-color" href="${pageContext.request.contextPath}/information">个人信息</a></li>
						<li class="dropdown">
							<a class="a-color" href="${pageContext.request.contextPath}/info/list"
							   class="dropdown-toggle" data-toggle="dropdown" role="button"
							   aria-haspopup="true" aria-expanded="false">我的订单
								<span class="caret"></span></a>
							<ul class="dropdown-menu">
								<li><a href="${pageContext.request.contextPath}/info/address">地址管理</a></li>
								<li><a href="${pageContext.request.contextPath}/order">交易中</a></li>
								<li role="separator" class="divider"></li>
								<li><a href="${pageContext.request.contextPath}/chatrobot">图灵智能聊天客服</a></li>
							</ul></li>
					</ul>

					<form class="navbar-form navbar-right" role="search" method="get" action="${pageContext.request.contextPath}/search">
						<div class="form-group">
							<input type="text" class="form-control" placeholder="Search" name="keyword">
						</div>
						<button type="submit" class="btn btn-default">
							<span class="glyphicon glyphicon-search" aria-label="搜索"></span>
						</button>
					</form>
				</div>
				<!-- /.navbar-collapse -->
			</div>
			<!-- /.container-fluid -->
		</nav>
	</div>
	<div id="main" class="container">

		<div class="login">
			<div class="row">
				<div class="col-md-6">
					<img src="./image/login.png" alt="" width="640" height="400" style="margin-left:-40px;margin-top:30px;">
				</div>
				<div class="col-md-5 form-login">
					<div>
						<!-- <h2 class="login-h2">登录</h2> -->
						<form class="form-horizontal" id="form2" action="${pageContext.request.contextPath}/loginconfirm" method="post">
							<div class="form-group">
								<label for="username" class="col-sm-2 control-label">用户名</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="username"
										name="username" placeholder="用户名">
								</div>
							</div>
							<div class="form-group">
								<label for="password" class="col-sm-2 control-label">密码</label>
								<div class="col-sm-10">
									<input type="password" class="form-control" id="password"
										name="password" placeholder="密码">
								</div>
							</div>
							<div class="form-group">
								<label for="confirmlogo" class="col-sm-2 control-label">验证码</label>
								<img src="${pageContext.request.contextPath}/verificationcodeimg" id="code" onclick="reloadcode()"
									style="cursor: pointer;" alt="看不清楚,换一张" width="100px">
								<div class="col-sm-10" style="width: 160px">
									<input type="text" class="form-control" id="confirmlogo"
										name="confirmlogo" placeholder="验证码">
								</div>
							</div>
							<div style="margin-left:80px;color:red;">
							</div>
							
							<div class="form-group">
								<div class="col-sm-offset-2 col-sm-10">
									<input type="submit" class="btn btn-primary login-input" value="登录"
										name="submit">
									<a href="" style="margin-left:10px;">忘记密码?</a>
									<div class="error">
										${errorMsg}
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>

		</div>
	</div>
</body>
</html>